home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 11 - 1995 / 11.02 Feb 95 / Yenta / Application Shellƒ / CPPYentaMenuBar.cp < prev    next >
Encoding:
Text File  |  1996-04-04  |  2.2 KB  |  90 lines  |  [TEXT/KAHL]

  1. /***************************************************** IMPLEMENTATION
  2.     DATE:    9/20/93
  3.     AUTHOR: Eric R. Rosé
  4.  
  5.     CLASS:  CPPYentaMenuBar
  6.     
  7.     SUPERCLASS: CPPMenuBar
  8.     
  9.         This C++ class manages the menu bar for our application
  10.     
  11. ********************************************************************/
  12.  
  13. #pragma once
  14.  
  15. #include "CPPYentaMenuBar.h"
  16. #include <CPPWindowManager.h>
  17. #include <CPPTEWindow.h>
  18. #include "MyCommands.h"
  19. #include "Commands.h"
  20.  
  21. extern    Boolean                gQuitApp;
  22. extern    CPPWindowManager    *gWindowManager;
  23.  
  24. /*-----------------------------------------------------------------*/
  25.  
  26. #define    kAppleMenu        1028
  27. #define        kAbout        1
  28.  
  29. #define    kFileMenu        1029
  30. #define        kPrefs        1
  31. #define        kAutoReply    2
  32. #define        kQuit        4
  33.  
  34. #define    kEditMenu        1030
  35. #define        kCut        1
  36. #define        kCopy        2
  37. #define        kPaste        3
  38. #define        kClear        4
  39. #define        kSelectAll    6
  40.  
  41. #define    kWindowMenu        1031
  42. #define        kSend        1
  43. #define        kMessage    2
  44. #define        kClose        4
  45.  
  46. /*-----------------------------------------------------------------*/
  47. /*------------------------ PUBLIC METHODS -------------------------*/
  48. /*-----------------------------------------------------------------*/
  49.  
  50.     CPPYentaMenuBar::CPPYentaMenuBar (void) : CPPMenuBar (128, kAppleMenu)
  51.     /* create a menu bar based on the passed-in resource template */
  52.     {
  53.         AddDAs (kAppleMenu);
  54.         SetCommandBindings();
  55.     }
  56.  
  57. /*-----------------------------------------------------------------*/
  58.  
  59.     CPPYentaMenuBar::~CPPYentaMenuBar (void)
  60.     {
  61.     }
  62.  
  63. /*-----------------------------------------------------------------*/
  64.  
  65.     char    *CPPYentaMenuBar::ClassName (void)
  66.     {
  67.         return "CPPYentaMenuBar";
  68.     }
  69.  
  70. /*-----------------------------------------------------------------*/
  71.  
  72.     void    CPPYentaMenuBar::SetCommandBindings (void)
  73.     {
  74.         BindCommand(kAppleMenu, kAbout, kCmdAbout);
  75.         
  76.         BindCommand(kFileMenu, kPrefs, kCmdPrefs);
  77.         BindCommand(kFileMenu, kAutoReply, kCmdAutoReply);
  78.         BindCommand(kFileMenu, kQuit, kCmdQuit);
  79.  
  80.         BindCommand(kEditMenu, kCut, kCmdCut);
  81.         BindCommand(kEditMenu, kCopy, kCmdCopy);
  82.         BindCommand(kEditMenu, kPaste, kCmdPaste);
  83.         BindCommand(kEditMenu, kClear, kCmdClear);
  84.         BindCommand(kEditMenu, kSelectAll, kCmdSelectAll);
  85.  
  86.         BindCommand(kWindowMenu, kSend, kCmdSend);
  87.         BindCommand(kWindowMenu, kMessage, kCmdMessage);
  88.         BindCommand(kWindowMenu, kClose, kCmdClose);
  89.     }
  90.